// 随机生成20以内的20个非0正整数，打印出来。对生成的数值，第单数个（不是索引）累加求和，第偶数个累乘求积。打印结果
package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	var sumOdd int
	var productEven int = 1
	for i := 1; i <= 20; i++ {
		randomInt := r.Intn(19) + 1
		fmt.Print(randomInt, " ")
		if i&1 == 0 {
			productEven *= randomInt
		} else {
			sumOdd += randomInt
		}
	}
	fmt.Println()
	fmt.Println(sumOdd)
	fmt.Println(productEven)
}
